from typing import List

class Solution:
    def dailyTemperatures(self, T: List[int]) -> List[int]:
        size = len(T)
        result = [0] * size
        stack = []
        for i in range(size):
            v = T[i]
            while len(stack) > 0 and v > T[stack[-1]]:
                j = stack.pop()
                result[j] = i - j
            stack.append(i)
        return result

solu = Solution()
print(solu.dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]))
